﻿@using QuestionsAnswers.UI.Models
@model QuestionsAnswers.UI.Models.Question
@{
    ViewBag.Title = "Edit";
    List<CourseAssignViewModel> courses = ViewBag.Courses;
}
<h2>
    Edit</h2>
@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Question</legend>
        @Html.HiddenFor(model => model.UserId)
        @Html.HiddenFor(model => model.QuestionId)
        <div class="editor-label">
            @Html.LabelFor(model => model.Text)
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.Text, 20, 70, null)
            @Html.ValidationMessageFor(model => model.Text)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.User.UserName, "User")
        </div>
        <div class="editor-field">
            @Html.DisplayFor(model => model.User.UserName)
        </div>

        
          <div class="editor-label">
	            @Html.Label("Assign to Course")
	        </div>
	        <div class="editor-field">

        @Html.Partial("CourseAssignPartial", courses)
        </div>
        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}
<div>
    @Html.ActionLink("Back to List", "Index")
</div>
